package com.kusej.idno.generation;

import com.intellij.ide.util.PropertiesComponent;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Getter
@Setter
public class DefaultData {
    private String provinceName;
    private String cityName;
    private String districtName;
    private String birthday;
    private Boolean isMale;
    private String num;


    public DefaultData() {

    }
    public static DefaultData getInstance(){
        DefaultData defaultData = new DefaultData();
        defaultData.provinceName = PropertiesComponent.getInstance().getValue("kusej.idCard.DefaultData.provinceName", "山东省");
        defaultData.cityName = PropertiesComponent.getInstance().getValue("kusej.idCard.DefaultData.cityName", "山东省菏泽市");
        defaultData.districtName = PropertiesComponent.getInstance().getValue("kusej.idCard.DefaultData.districtName", "山东省菏泽市定陶区");
        defaultData.birthday = PropertiesComponent.getInstance().getValue("kusej.idCard.DefaultData.birthday", "19900125");
        defaultData.num = PropertiesComponent.getInstance().getValue("kusej.idCard.DefaultData.num", "5");
        defaultData.isMale = PropertiesComponent.getInstance().getBoolean("kusej.idCard.DefaultData.isMale");
        return defaultData;
    }
    public static void save(DefaultData defaultData) {
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.provinceName", defaultData.provinceName);
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.cityName", defaultData.cityName);
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.districtName", defaultData.districtName);
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.birthday", defaultData.birthday);
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.num", defaultData.num);
        PropertiesComponent.getInstance().setValue("kusej.idCard.DefaultData.isMale", defaultData.isMale);
    }
}
